#include "drv_led.h"
#include "drv_beep.h"
#include "FreeRTOS.h"
#include "task.h"

#include "usart.h"
#include "adc.h"
char buf[128] = {0};
int num = 0;

TaskHandle_t LEDHanle;
TaskHandle_t BeepHanle;
TaskHandle_t ADCHanle;


void vTaskLED(void * pvParameters)
{
	for(;;)
	{
		drv_led_open(GPIO_Pin_8);
		vTaskDelay(1000);
		drv_led_close(GPIO_Pin_8);
		vTaskDelay(1000);
//		vTaskDelete(LEDHanle);
	}
}

void vTaskBeep(void * pvParameters)
{
	for(;;)
	{
		drv_beep_open();
		vTaskDelay(500);
		drv_beep_close();
		vTaskDelay(500);
	}
}
void vTaskADC(void *pvParameters)
{
	for(;;)
	{
		printf("adc_data = %d\r\n",adcAverageValue());
		vTaskDelay(2000);
	}
}

int main(){
//	drv_led_init(GPIO_Pin_8);
//	drv_beep_init();
	
	usart1Init();
	//adcInit();
	printf("adc_data = \r\n");
//	xTaskCreate(vTaskLED,"vTaskLED",128,NULL,1,&LEDHanle);
//	xTaskCreate(vTaskBeep,"vTaskBeep",128,NULL,2,&BeepHanle);
	//xTaskCreate(vTaskADC,"vTaskADC",256,NULL,2,&ADCHanle);

	//vTaskStartScheduler();
	
	while(1)
	{
		
	}
}



